<style>
	#myTabContent img{width: 120px;height: 60px;}
</style>

<div id="myTabContent" class="tab-content">
	<div class="tab-pane fade in active" id="search" style="margin-bottom: 50px">
		<a href="{:url('addBottomImg')}" class='btn btn-sm btn-primary pull-left'>添加</a>
	</div>

	<table class="table table-bordered" id="list-table">
		<thead>
		<tr>
			<th>ID</th>
			<th>图片</th>
			<th>添加时间</th>
			<th>操作</th>
		</tr>
		</thead>
		<tbody>
		{foreach name="list" item="l" key="k"}
			<tr data-id="{$l['id']}">
				<td>{$k+1}</td>
				<td><img src="{$l['image']}"></td>
				<td>{$l.update_time}</td>
				<td class="operation">
					<a class="btn btn-xs btn-danger del_btn" href="javaScript:void(0);">
						<i class="glyphicon ">删除</i>
					</a>
				</td>
			</tr>
		{/foreach}
		</tbody>
	</table>
	<div class="text-center">
		{$page}
	</div>
</div><!--myTabContent-->

<script>
    $(".sy").addClass("active open");
    $(".sy .dblb").addClass("active");
</script>
<script>
    //删除渠道
    $('.del_btn').on('click', function(e){
        let id = this.parentNode.parentNode.getAttribute('data-id');
        bootbox.confirm("是否删除该数据",function(result){
            if(result){
                $.post("{:url('deleteBottomImg')}",{'id':id},function(data){
                    bootbox.alert(data['message'], function(){
						window.location.reload();
                    });
                });
            }
        });
    });
</script>
